{extend name="base" /} {block name="body"}
<div class="layui-body">
	<div class="navbar">
		<a><cite>系统设置</cite></a>&nbsp;<span class="layui-box">&gt;</span>
		<a href=""><cite>菜单权限</cite></a>
	</div>
	<!--tab标签-->
	<div class="layui-tab layui-tab-brief">
		<blockquote class="layui-elem-quote">
			<form class="layui-form" action="{:url()}" method="get">
				<div class="layui-inline">
					<div class="layui-input-inline">
						<input type="text" placeholder="请输入关键字" class="layui-input">
					</div>
					<a class="layui-btn search_btn"><i class="fa fa-search"></i> 查询</a>
					<a class="layui-btn layui-btn-normal" href="{:url('add')}"><i class="fa fa-plus-circle"></i> 添加</a>
					<a class="layui-btn layui-btn-status page-btns" href="{:url('status',['table'=>'auth_rule','val'=>1])}"><i class="fa fa-check-circle-o"></i> 启用</a>
					<a class="layui-btn layui-btn-danger page-btns" href="{:url('status',['table'=>'auth_rule','val'=>2])}"><i class="fa fa-ban"></i> 禁用</a>
					<a class="layui-btn layui-btn-error page-btns confirm" href="{:url('delete',['table'=>'auth_rule'])}"><i class="fa fa-trash-o"></i> 删除</a>
				</div>
			</form>
		</blockquote>
		<div class="layui-tab-content">
			<table class="layui-table layui-form">
				<thead>
					<tr>
						<th style="width: 30px;">
							<input type="checkbox" lay-skin="primary" lay-filter="allChoose">
						</th>
						<th style="width: 50px;">排序</th>
						<th>菜单名称</th>
						<th>控制器方法</th>
						<th>状态</th>
						<th>操作</th>
					</tr>
				</thead>
				<tbody>
					<form id="listForm">
						{foreach name="admin_menu_level_list" item="vo"}
						<tr>
							<td>
								<input type="checkbox" name="ids[]" value="{$vo.id}" class="layui-checkbox checkbox-ids" lay-skin="primary">
							</td>
							<td>
								<input type="text" class="layui-input input-sort" maxlength="3" onkeyup="value=value.replace(/[^\d]/g,'')" value="{$vo.sort}" data-value="{$vo.sort}" data-href="{:url('sorts',['table'=>'auth_rule','id'=>$vo.id])}">
							</td>
							<td>
								{neq name="vo.level" value="1"}|{php} for($i=1;$i
								<$vo[ 'level'];$i++){echo ' ----';}{/php}{/neq} {$vo.title} </td>
									<td>{$vo.name}</td>
									<td>
										<input type="checkbox" data-href="{:url('status',['table'=>'auth_rule','id'=>$vo.id])}" {if $vo.status==1}checked{/if} value="{$vo.status}" lay-skin="switch" lay-filter="switchStatus" lay-text="正常|关闭">
									</td>
									<td>
										<a href="{:url('add',['pid'=>$vo.id])}" class="layui-btn layui-btn-normal layui-btn-small"><i class="fa fa-plus-circle"></i> 子菜单</a>
										<a href="{:url('update',['id'=>$vo.id])}" class="layui-btn layui-btn-small"><i class="fa fa-edit"></i> 编辑</a>
										<a href="{:url('delete',['id'=>$vo.id,'table'=>'auth_rule'])}" class="layui-btn layui-btn-error layui-btn-small ajax-do"><i class="fa fa-trash-o"></i> 删除</a>
									</td>
						</tr>
						{/foreach}
					</form>
				</tbody>
			</table>
		</div>
	</div>
</div>
{/block}